#ifndef VERSIONCHECK_H
#define VERSIONCHECK_H

#include "../HTTP/HTTPDownload.h"

#include <QObject>

#include <QJsonDocument>
#include <QJsonObject>

class VersionCheck : public QObject
{
    Q_OBJECT
public:
    explicit VersionCheck(QObject *parent = nullptr);
    virtual ~VersionCheck();

signals:
    void s_JsonParseResult();
    void s_Critical(QString msg);

public slots:
    int checkVersion();

protected:
    int parseJsonVersion(QByteArray &byteArray);


//数据成员
public:
    QString m_strJsonURL;    //Json地址

    int m_nLastestVersion;              //最新版本
    int m_nForceVersion;                //强制升级版本
    QString m_strBroadcastContent;      //广播内容
    int m_nBroadcastVersion;            //广播版本
    QString m_strUpdateURL;             //下载地址

private:
    //升级检测
    HTTPDownload m_HTTP;

};

#endif // VERSIONCHECK_H
